package com.lightjet.macross.base.awf.service;

import com.lightjet.macross.base.awf.domain.BizAgent;
import com.lightjet.macross.common.core.BaseService;
import com.lightjet.macross.common.dto.ResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author : lijia
 * @version : 1.0 2019-04-03 09:02
 * description : 流程代理服务层接口
 */
public interface BizAgentService extends BaseService<BizAgent,Integer> {

    /**
     * Description 刷新当前代理表中已经过期的授权
     * @author lijia
     * @Param []
     * @return com.lwl.jmf.core.dto.ResultDTO
     * CreateTime 2019/4/3 9:25
     **/
    ResultDTO RefreshExpired();

    /**
     * Description 根据被代理人ID获取已经授权的代理信息
     * @author lijia
     * @Param [principalid]
     * @return java.util.List<com.lwl.jmf.activiti.domain.BizAgent>
     * CreateTime 2019/4/3 9:40
     **/
    List<BizAgent> GetAgentsByPrincipalId(String principalid, byte enable);

    /**
     * Description 批量撤销授权
     * @author lijia
     * @Param [ids]
     * @return com.lwl.jmf.core.dto.ResultDTO
     * CreateTime 2019/4/5 10:50
     **/
    ResultDTO<String> BatchExpire(List<Integer> ids);

    /*    *//**
     * Description 根据流程
     * @author lijia
     * @Param [principalid, prockey]
     * @return com.lwl.jmf.activiti.domain.BizAgent
     * CreateTime 2019/4/5 15:50
     **//*
    BizAgent GetAgentsByPrincipalIdAndProcKey(String principalid,String prockey);*/

    /**
     * description:批量处理授权代理操作
     *
     * @param agents
     * @param trans
     */
    @Transactional
    public ResultDTO<String> GrantAgent(List<BizAgent> agents, boolean trans);
}
